﻿namespace CsharpHomework01
{
    internal class Program
    {/// <summary>
     /// 根据分数划分等级
     /// </summary>
     /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.WriteLine("请输入一个0~100的整数");
            //读取下一个字符
            string ?Input = Console.ReadLine();
            //转换字符为整数
            if (int.TryParse(Input, out int score))
            {
                //确保数字在0~100
                if (score >= 0 && score <= 100)
                {
                    
                    //选择分数段和等级
                        if (score >= 70)
                        {
                            if (score >= 80)
                            {
                                if (score >= 90)
                                {
                                    Console.WriteLine("A");
                                }
                                else { Console.WriteLine("B"); }
                            }
                            else
                            { Console.WriteLine("C"); }
                        }
                        else { Console.WriteLine("D"); }
                    }
                    else
                    { Console.WriteLine("不识字是吧，0~100的数字，OK？"); }
                }
                else { Console.Write("转换失败"); }
            }
        }
    }

